package com.codeplay.repository;

import com.codeplay.entity.ProjectComment;
import com.codeplay.entity.ProjectComment.UserRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface ProjectCommentRepository extends JpaRepository<ProjectComment, Long> {
    List<ProjectComment> findByProjectId(Long projectId);
    List<ProjectComment> findByTaskId(Long taskId);
    List<ProjectComment> findByUserId(Long userId);
    List<ProjectComment> findByProjectIdAndTaskId(Long projectId, Long taskId);
    
    List<ProjectComment> findByIsReviewedFalse();
    List<ProjectComment> findByIsAppropriate(Boolean isAppropriate);
    List<ProjectComment> findByReviewedBy(Long reviewerId);
    
    List<ProjectComment> findByUserIdAndUserRole(Long userId, UserRole userRole);
    List<ProjectComment> findByProjectIdAndParentVisibleTrue(Long projectId);
    List<ProjectComment> findByUserIdAndParentVisibleTrue(Long userId);
    
    List<ProjectComment> findByProjectIdAndIsAppropriateTrue(Long projectId);
    List<ProjectComment> findByTaskIdAndIsAppropriateTrue(Long taskId);
    List<ProjectComment> findByUserIdAndIsAppropriateTrue(Long userId);
    
    void deleteByProjectId(Long projectId);
    void deleteByTaskId(Long taskId);
    void deleteByUserIdAndUserRole(Long userId, UserRole userRole);
} 